//
//  RYDingdanModel.swift
//  SheYangBigData
//
//  Created by 宋海胜 on 2021/1/22.
//  Copyright © 2021 叁拾叁. All rights reserved.
//

import UIKit
import HandyJSON
import RxSwift

struct RYDingdanModel: HandyJSON, Equatable {
    var status: Int?
    var adoptTime: String?
    var shippingAddressId: Int?
    var adoptStatus: Int? //认养状态（1待付款2认养中3配送中4已完成5已取消）
    var upStringString: String?
    var sort: Int?
    var orderNumber: String?
    var adoptUserContact: String?
    var deliveryCycle: Int?
    var uuid: String?
    var adoptNumber: String?
    var farmProductId: Int?
    var predictMatureTime: String?
    var version: Int?
    var deliveryWay: Int?
    var deliveryCycleName: String?
    
    var adoptShippingAddressVO: AdoptShippingAddressVO?
    var id: String?
    var tenantId: Int?
    var deliveryWayName: String?
    var createBy: Int?
    var upStringBy: Int?
    var orderQuantity: Int?
    var trackingNumber: String? //TODO: Specify the type to conforms Codable protocol
    var farmName: String?
    var remarks: String?
    var adoptUserName: String?
    var createString: String?
    var orderTime: String?
    
    var adoptFarmProductVO: AdoptFarmProductVO?
    var payWay: Int?
    var orderPrice: Double?
    
    func getRenyangStatus() -> String {
        switch self.adoptStatus {
        case 1:
            return "待付款"
        case 2:
            return "认养中"
        case 3:
            return "配送中"
        case 4:
            return "已完成"
        case 5:
            return "已取消"
        default:
            return ""
        }
    }
    
    func getZhifufangshi() -> String {
        switch self.payWay {
        case 1:
            return "微信支付"
        case 2:
            return "支付宝支付"
        case 3:
            return "余额支付"
       
        default:
            return ""
        }
    }
}


struct AdoptShippingAddressVO: HandyJSON, Equatable {
    var status: String? //TODO: Specify the type to conforms Codable protocol
    var upStringString: String? //TODO: Specify the type to conforms Codable protocol
    var sort: String? //TODO: Specify the type to conforms Codable protocol
    var districtName: String?
    var uuid: String? //TODO: Specify the type to conforms Codable protocol
    var streetName: String?
    var version: String? //TODO: Specify the type to conforms Codable protocol
    var name: String?
    var isDefault: Int?
    var id: String? //TODO: Specify the type to conforms Codable protocol
    var tenantId: String? //TODO: Specify the type to conforms Codable protocol
    var appUserId: Int?
    var createBy: String? //TODO: Specify the type to conforms Codable protocol
    var upStringBy: String? //TODO: Specify the type to conforms Codable protocol
    var mobile: String?
    var provinceId: String?
    var provinceName: String?
    var cityId: String?
    var streetId: String?
    var remarks: String? //TODO: Specify the type to conforms Codable protocol
    var createString: String? //TODO: Specify the type to conforms Codable protocol
    var districtId: String?
    var cityName: String?
    var address: String?
}


struct AdoptFarmProductVO: HandyJSON, Equatable {
    var adoptHarvestUnit: String?
    var id: String? //TODO: Specify the type to conforms Codable protocol
    var carouselImgUrl: String?
    var adoptHarvestNum: Int?
    var dictionaryId: Int?
    var productionCycleEnd: String?
    var tenantId: String? //TODO: Specify the type to conforms Codable protocol
    var description: String?
    var version: String? //TODO: Specify the type to conforms Codable protocol
    var present: String?
    var uuid: String? //TODO: Specify the type to conforms Codable protocol
    var sort: String? //TODO: Specify the type to conforms Codable protocol
    var type: String? //TODO: Specify the type to conforms Codable protocol
    var upStringString: String? //TODO: Specify the type to conforms Codable protocol
    var farmId: Int?
    var farmName: String? //TODO: Specify the type to conforms Codable protocol
    var serialNumber: String?
    var adoptedPercent: String? //TODO: Specify the type to conforms Codable protocol
    var adoptHarvest: String?
    var deviceId: String?
    var upStringBy: String? //TODO: Specify the type to conforms Codable protocol
    var name: String?
    var remarks: String? //TODO: Specify the type to conforms Codable protocol
    var typeName: String? //TODO: Specify the type to conforms Codable protocol
    var productionCycleBegin: String?
    var createBy: String? //TODO: Specify the type to conforms Codable protocol
    var status: String? //TODO: Specify the type to conforms Codable protocol
    var unitPrice: Double?
    var remainNum: Int?
    var adoptPeopleNum: Int?
    var purchaseLimit: Int?
    var createString: String? //TODO: Specify the type to conforms Codable protocol
    var adoptPart: String?
    var priceDescription: String?
    var productionCycle: Int?
    var traceRecords: String? //TODO: Specify the type to conforms Codable protocol
    var adoptPrice: Double?
    var adoptedNum: Int?
    var totalNum: Int?
    var detailImgUrl: String?
}
